using System;
using Microsoft.ApplicationServer.Caching;

namespace Framework.DataCache
{
    public class DistributedDataCacheOperationDescriptor
    {
        private readonly DataCacheOperationDescriptor _dataCacheOperationDescriptor;
        private readonly DistributedDataCacheItemVersion _distributedDataCacheItemVersion;

        internal DistributedDataCacheOperationDescriptor(DataCacheOperationDescriptor dataCacheOperationDescriptor)
        {
            _dataCacheOperationDescriptor = dataCacheOperationDescriptor;
            _distributedDataCacheItemVersion = new DistributedDataCacheItemVersion(_dataCacheOperationDescriptor.Version);
        }

        public string RegionName
        {
            get
            {
                return _dataCacheOperationDescriptor.RegionName;
            }
        }

        public string Key
        {
            get
            {
                return _dataCacheOperationDescriptor.Key;
            }
        }

        public string CacheName
        {
            get
            {
                return _dataCacheOperationDescriptor.CacheName;
            }
        }

        public DistributedDataCacheOperations OperationType
        {
            get
            {
                return (DistributedDataCacheOperations)Convert.ToInt32(_dataCacheOperationDescriptor.OperationType);
            }
        }

        public DistributedDataCacheItemVersion Version
        {
            get
            {
                return _distributedDataCacheItemVersion;
            }
        }
    }
}